home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD001b.dsk
/
DOLLAR.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
1KB
|
28 lines
10 TEXT : HOME
20 PRINT "<CTRL-J>----------------------------------------": INPUT "NUMBER TO FIX ? ";X: PRINT : PRINT X;: GOSUB 100: PRINT TAB( 40 - LEN(A$))A$: GOTO 20
80 REM *************************
82 REM IT WILL NOT EXCEPT<CTRL-J>
83 REM NUMBERS >=1000000000 OR<CTRL-J>
84 REM <.001<CTRL-J>
85 REM MAIN ROUTINE STARTS AT<CTRL-J>
86 REM LINE 100. BEFORE MERGING<CTRL-J>
87 REM WITH YOUR PROGRAM<CTRL-J>
88 REM "DEL" LINES 10-95<CTRL-J>
90 REM SEND THE VAL. TO BE FIXED
91 REM IN THE VAR. X<CTRL-J>
92 REM THE RESULT IS RETURNED<CTRL-J>
93 REM IN THE VAR. A$<CTRL-J>
94 REM THE VAR. X IS SCRAMBLED<CTRL-J>
95 REM *************************
100 IF X > = 1000000000 OR X <.01 THEN X = 0
105 A$ = "$" + STR$(X): FOR X = 1 TO LEN(A$)
110 IF MID$ (A$,X,1) = "." THEN 130
115 NEXT X
120 A$ = A$ +".00": GOTO 140
130 IF X +1 = LEN(A$) THEN A$ = A$ +"0"
132 IF X +2 < > LEN(A$) THEN A$ = LEFT$(A$,X +2)
140 FOR X = 7 TO 17 STEP 4
150 IF LEN(A$) >X THEN A$ = LEFT$(A$, LEN(A$) -X +1) +"," + RIGHT$(A$,X -1)
155 NEXT X
160 IF LEN(A$) <5 THEN A$ = LEFT$(A$,1) +"0" + RIGHT$(A$,3)
170 RETURN